#include "car.h"

void Car_Go(uint16_t car_vel,uint16_t car_acc,float n)
{

	Emm_V5_Pos_Control(LF,CW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(LB,CW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(RF,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(RB,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Synchronous_motion(0);

}

void Car_Back(uint8_t car_vel,uint8_t car_acc,float n)
{
	
	Emm_V5_Pos_Control(LF,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(LB,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(RF,CW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(RB,CW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Synchronous_motion(0);
	
}

void Car_Left(uint16_t car_vel,uint16_t car_acc,float n)
{

	Emm_V5_Pos_Control(LF,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(LB,CW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(RF,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(RB,CW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Synchronous_motion(0);

}

void Car_Turnleft(uint8_t car_vel,uint8_t car_acc,float n)
{

	Emm_V5_Pos_Control(LF,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(LB,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(RF,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(RB,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Synchronous_motion(0);

}

void Car_Right(uint16_t car_vel,uint16_t car_acc,float n)
{

	Emm_V5_Pos_Control(LF,CW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(LB,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(RF,CW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Pos_Control(RB,CCW,car_vel,car_acc,n*rad,0,1);
	Emm_V5_Synchronous_motion(0);

}
